from crud.database import Database
from model.llm_api import LangChainModel
from services.chat_service import ChatService
from services.connect_mananger import ConnectionManager
from services.tts_model_manager import TTSModelManager
from model.voice_v2pro1.local_api import InitTTS
from config import MODEL_NAME,PROMPT_CONFIG

# 创建单例实例
db_instance = Database()
model_instance = LangChainModel(model_name=MODEL_NAME)
tts_model_manager_instance = TTSModelManager(
    character_configs=PROMPT_CONFIG["character_prompt"]
)
connection_manager_instance = ConnectionManager()
chat_service_instance = ChatService(db=db_instance, model=model_instance,tts_model_manager = tts_model_manager_instance,connection_manager = connection_manager_instance)


# 创建依赖项 "getter" 函数
def get_chat_service() -> ChatService:
    return chat_service_instance

def get_websocket_service() -> ConnectionManager:
    return connection_manager_instance